@extends('default.layouts.companyPublic')

@section('title', '新增部门')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/company/form.css')}}">
@endsection

@section('rightcon')

    <div class="right">
        <div class="jright">
            <div class="content">
                <div class="jobtitle">
                    <div class="tithead">
                        <ul>
                            <li><a href="{{url('company/basic_info')}}">基本资料</a></li>
                            <li class="active"><a href="{{url('company/department')}}">部门管理</a></li>
                            <li><a href="{{url('company/map')}}">地图坐标</a></li>
                            <li><a href="{{url('company/photo')}}">企业相册</a></li>
                        </ul>
                    </div>
                </div>
                <div class="nav_totitle">
                    <span class="line"><span>新增部门</span></span>
                </div>

                <div class="manage" style="padding: 0; margin-bottom: 10px;">
                    @if(count($errors)>0)
                        <div class="mark">
                            @if(is_object($errors))
                                @foreach($errors->all() as $error)
                                    <p>{{$error}}</p>
                                @endforeach
                            @else
                                <p>{{$errors}}</p>
                            @endif
                        </div>
                    @endif
                </div>

                <div class="department">
                    <form name="departmentform" id="departmentform" action="{{url('company/department/store')}}"
                          onsubmit="return false" method="post" novalidate="novalidate">
                        {!! csrf_field() !!}
                        <dl>
                            <dt>
                                <em>*</em>
                                <span>部门名称</span>
                            </dt>
                            <dd>
                                <input name="name" type="text" value="{{old('name')}}" id="name" style="width:260px;"/>
                            </dd>
                            <dd class="errinfo"></dd>
                        </dl>
                        <dl>
                            <dt>
                                <em>*</em>
                                <span>联系人</span>
                            </dt>
                            <dd>
                                <input name="contacts" type="text" value="{{old('contacts')}}" id="contacts"
                                       style="width:120px;"/>
                            </dd>
                            <dd class="errinfo"></dd>
                        </dl>
                        <dl>
                            <dt>
                                <em>*</em>
                                <span>手机号码</span>
                            </dt>
                            <dd>
                                <input name="mobile" type="text" value="{{old('mobile')}}" id="mobile"
                                       style="width:300px;"/>
                            </dd>
                            <dd class="errinfo"></dd>
                        </dl>
                        <dl>
                            <dt>
                                <em>*</em>
                                <span>电话</span>
                            </dt>
                            <dd>
                                <input name="phone" type="text" id="phone" value="{{old('phone')}}"
                                       placeholder="格式例如 0576-82441111"
                                       style="width:200px;"/>
                            </dd>
                            <dd class="errinfo"></dd>
                        </dl>
                        <dl>
                            <dt>
                                <em></em>
                            </dt>
                            <dd><span class="note">注：手机号码和电话号码必须填写一个</span></dd>
                        </dl>
                        <dl>
                            <dt>
                                <em></em>
                                <span>传真</span>
                            </dt>
                            <dd>
                                <input name="fax" type="text" id="fax" value="{{old('fax')}}" style="width:200px;"/>
                            </dd>
                            <dd class="errinfo"></dd>
                        </dl>
                        <dl>
                            <dt>
                                <em></em>
                                <span>Email</span>
                            </dt>
                            <dd>
                                <input name="email" type="text" id="email" value="{{old('email')}}"
                                       style="width:260px;"/>
                            </dd>
                            <dd class="errinfo"></dd>
                        </dl>
                        <div class="department_save">
                            <span><input type="submit" name="savenav" id="savenav" value="保 存"/></span>
                            <span><a href="javascript:history.go(-1);">取 消</a></span>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
@section('footerjs')
    @parent
    <script type="text/javascript" src="{{asset('/default/js/company/department.js')}}"></script>
@endsection
